import java.util.Arrays;
import java.util.Random;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: xiaotutu
 * Date: 2024-12-06
 * Time: 15:05
 */
public class TestSort {


    /*public static void testInsertSort(int[] array) {
        array = Arrays.copyOf(array, array.length);
        Long startTime = System.currentTimeMillis();
        Sort.insertSort(array);
        Long endTime = System.currentTimeMillis();
        System.out.println("插入排序耗费时间: " + (endTime - startTime));
    }


    public static void testShellSort(int[] array) {
        array = Arrays.copyOf(array, array.length);
        Long startTime = System.currentTimeMillis();
        Sort.shellSort(array);
        Long endTime = System.currentTimeMillis();
        System.out.println("希尔排序耗费时间: " + (endTime - startTime));
    }

    public static void testSelectSort(int[] array) {
        array = Arrays.copyOf(array,array.length);
        long startTime = System.currentTimeMillis();
        Sort.selectSort(array);
        long endTime = System.currentTimeMillis();
        System.out.println("选择排序耗费时间："+ (endTime - startTime));
    }

    public static void testHeapSort(int[] array) {
        array = Arrays.copyOf(array,array.length);
        long startTime = System.currentTimeMillis();
        Sort.heapSort(array);
        long endTime = System.currentTimeMillis();
        System.out.println("堆排序耗费时间："+ (endTime - startTime));
    }

    public static void testQuickSort(int[] array) {
        array = Arrays.copyOf(array,array.length);
        long startTime = System.currentTimeMillis();
        Sort.quickSort(array);
        long endTime = System.currentTimeMillis();
        System.out.println("快速排序耗费时间："+ (endTime - startTime));
    }
    *//**
     * 数组顺序排放
     * @param array
     *//*
    public static void orderArray(int[] array) {
        for (int i = 0; i < array.length; i++) {
            // array[i] = i;
            array[i] = array.length-i;
        }
    }

    *//**
     * 数组乱序排放
     * @param array
     *//*
    public static void notOrderArray(int[] array) {
        Random random = new Random();
        for (int i = 0; i < array.length; i++) {
            array[i] = random.nextInt(10_0000);
        }
    }


    public static void main(String[] args) {
        int[] array = new int[1_0000];
        orderArray(array);
        // notOrderArray(array);
        testInsertSort(array);
        testHeapSort(array);
        testQuickSort(array);
    }*/
}
